package com.muyu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.mapper.UserQuestionsMapper;
import com.muyu.model.entity.UserQuestionsEntity;
import com.muyu.service.UserQuestionsService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: UserQuestionsServiceImpl
 * @Author: Zirun.Xin
 * @Date: 2025/4/29 下午2:29
 * @Version: 1.0
 * @Description: 问题反馈业务实现层
 */
@Service
@RequiredArgsConstructor
public class UserQuestionsServiceImpl extends ServiceImpl<UserQuestionsMapper, UserQuestionsEntity>
        implements UserQuestionsService {

    /**
     * 问题反馈持久层
     */
    private final UserQuestionsMapper userQuestionsMapper;

    /**
     * 获取已上传过截图的问题反馈
     *
     * @return 获取数据
     */
    @Override
    public List<UserQuestionsEntity> getQuestions() {
        LambdaQueryWrapper<UserQuestionsEntity> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.isNotNull(UserQuestionsEntity::getFilePaths);
        List<UserQuestionsEntity> userQuestionsEntityList = userQuestionsMapper.selectList(queryWrapper);
        return userQuestionsEntityList;
    }
}
